﻿/// Copyright © 2013 Microsoft Corporation. 
/// This project is released under the Microsoft Public License (MS-PL)
///
namespace DataMorph.Generator
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;

    using DataMorph.Common.Contracts;

    public class TagDataSet
    {
        private readonly IDictionary<int, IReadOnlyList<string>> files = new Dictionary<int, IReadOnlyList<string>>();

        public TagDataSet(string name, IList<Tag> tags, DateTime fromDate, DateTime toDate)
        {
            this.Name = name;
            this.Tags = new ReadOnlyCollection<Tag>(tags);
            this.FromDate = fromDate;
            this.ToDate = toDate;
        }

        public string Name { get; private set; }

        public IReadOnlyList<Tag> Tags { get; private set; }

        public DateTime FromDate { get; private set; }

        public DateTime ToDate { get; private set; }

        public IReadOnlyDictionary<int, IReadOnlyList<string>> Files 
        { 
            get
            {
                return new ReadOnlyDictionary<int, IReadOnlyList<string>>(this.files);
            } 
        }

        public void AddFiles(int day, IEnumerable<string> paths)
        {
            this.files[day] = new ReadOnlyCollection<string>(paths.ToList());
        }
    }
}